package com.easysoft.framework.role.service;

import com.easysoft.commons.utils.UUIDUtils;
import com.easysoft.framework.role.mapper.UserRoleMapperExtd;
import com.easysoft.framework.role.model.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service("service.UserRoleService")
public class UserRoleService {

    @Autowired
    @Qualifier("mapper.UserRoleMapperExtd")
    private UserRoleMapperExtd userRoleMapperExtd;

    public int addUserRole(UserRole userRole){
        userRole.setId(UUIDUtils.getUUID());
        userRole.setCreateTime(new Date());
        return userRoleMapperExtd.insertSelective(userRole);
    }

    public int deleteUserRoleByUserId(String id){
        return userRoleMapperExtd.deleteUserRoleByUserId(id);
    }

}
